﻿using System;
using System.Collections.Generic;
using mvcForum.Core.Interfaces;
using mvcForum.Core.Interfaces.AddOns;
using mvcForum.SearchProvider.Lucene.Controllers;
using mvcForum.Web.Interfaces;
using mvcForum.Core.Interfaces.Search;
using mvcForum.Core.Abstractions;
using mvcForum.Core.Interfaces.DependencyManagement;

namespace mvcForum.SearchProvider.Lucene {

	public abstract class LuceneBaseSearchBuilder : IDependencyBuilder {

		public virtual void Configure(IDependencyContainer container) {
			// Register the indexer.
			container.Register<IIndexer, Indexer>();
			// Register the searcher.
			container.Register<ISearcher, Indexer>();

			container.Register<ISearchAddOn, Indexer>();
			container.Register<IAddOnConfiguration<Indexer>, LuceneConfiguration>();
			container.Register<AsyncAddOnConfiguration<Indexer>, LuceneConfiguration>();
			container.Register<ISearchConfigurationController, LuceneConfigurationController>();

			container.Register<IInstallable, LuceneInstall>();

			//ApplicationPartRegistry.Register(typeof(LuceneSearchBuilder).Assembly);
		}

		public abstract void ValidateRequirements(IList<ApplicationRequirement> feedback);
	}
}